package com.yingside.collection.homework;

import javax.swing.*;
import java.util.HashSet;
import java.util.Set;

public class Test4 {
    public static void main(String[] args) {

        Set<Integer> redBalls = new HashSet<>();

        while(redBalls.size() <= 6){
            int r = myRandom(1, 33);
            redBalls.add(r);
        }

        System.out.println("6个红色球是:" + redBalls);


        System.out.println("蓝色球是:" + myRandom(1,16));
    }

    public static int myRandom(int min, int max){
        return (int)(Math.random() * (max - min + 1) + min);
    }
}
